﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="Register.aspx.cs" Inherits="Register" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style2
        {
            width: 428px;
        }
        .style3
        {
            width: 254px;
        }
        .style4
        {
        }
        .style5
        {
        }
        .style6
        {
            width: 317px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" src="Scripts/SHA1.js"></script>
    <table class="style2">
        <tr>
            <td class="style6">
                First Name:<asp:Label 
                    ID="StarLabel" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
            </td>
            <td class="style3">
                <asp:TextBox ID="FirstNameTextBox" runat="server" Width="170px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style6">
                Last Name:<asp:Label ID="StarLabel0" runat="server" 
                    ForeColor="#FF3300" Text="*"></asp:Label>
            </td>
            <td class="style3">
                <asp:TextBox ID="LastNameTextBox" runat="server" Width="170px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style6">
                Username:<asp:Label ID="StarLabel1" runat="server" 
                    ForeColor="#FF3300" Text="*"></asp:Label>
            </td>
            <td class="style3">
                <asp:TextBox ID="UsernameTextBox" runat="server" Width="170px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style6">
                Password:<asp:Label ID="StarLabel2" runat="server" 
                    ForeColor="#FF3300" Text="*"></asp:Label>
            </td>
            <td class="style3">
                <asp:TextBox ID="PasswordTextBox" runat="server" TextMode="Password" 
                    Width="170px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style6">
                Confirm Password:<asp:Label ID="StarLabel3" runat="server" 
                    ForeColor="#FF3300" Text="*"></asp:Label>
            </td>
            <td class="style3">
                <asp:TextBox ID="ConfirmPasswordTextBox" runat="server" TextMode="Password" 
                    Width="170px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style6">
                Phone Number:<asp:Label ID="StarLabel4" runat="server" 
                    ForeColor="#FF3300" Text="*"></asp:Label>
            </td>
            <td class="style3">
                <asp:TextBox ID="PhoneNumberTextBox" runat="server" Width="170px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style6">
                Email:<asp:Label ID="StarLabel5" runat="server" 
                    ForeColor="#FF3300" Text="*"></asp:Label>
            </td>
            <td class="style3">
                <asp:TextBox ID="EmailTextBox" runat="server" Width="170px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style6">
                Moderator Password(Optional):</td>
            <td class="style3">
                <asp:TextBox ID="ModeratorPasswordTextBox" runat="server" Width="170px" TextMode="Password"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style5" align="center" colspan="2">
                <asp:Label ID="FieldProblemLabel" runat="server" ForeColor="#FF3300" 
                    Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style4" align="center" colspan="2" valign="bottom">
                <asp:Button ID="SubmitButton" runat="server" Text="Submit" Width="77px" 
                    onclick="SubmitButton_Click" OnClientClick="encrypt()"/>
                <asp:ObjectDataSource ID="RegisterDS" runat="server" 
                    SelectMethod="register" TypeName="ForumLibrary.Data.ForumWebManager" 
                    onselecting="RegisterDS_Selecting">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="FirstNameTextBox" Name="firstName" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="LastNameTextBox" Name="lastName" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="UsernameTextBox" Name="username" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="PasswordTextBox" Name="password" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="EmailTextBox" Name="email" PropertyName="Text" 
                            Type="String" />
                        <asp:ControlParameter ControlID="PhoneNumberTextBox" Name="phone" 
                            PropertyName="Text" Type="String" />
                        <asp:Parameter Name="isModerator" Type="Boolean" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        function encrypt() {
            var p = document.getElementById("MainContent_PasswordTextBox").value;
            document.getElementById("MainContent_PasswordTextBox").value = SHA1(p);
        }

    </script>
</asp:Content>
